<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>Document</title>
	<link rel="stylesheet" href="lib/bootstrap-3.3.7.css">
	<script type="text/javascript" src="lib/vue-2.4.0.js"></script>
	<script type="text/javascript" src="lib/vue-router.min.js"></script>
	<style>
	

	</style>
</head>
<body>
	<div id="app">

		<router-link to="/account">Account(账户)</router-link>

		<router-view></router-view>

	</div>
	<template id="tem">
		<div>
			<h1>这是一个账户中心</h1>
			<router-link to="/account/login">登录</router-link>
			<router-link to="/account/register">注册</router-link>
			<router-view></router-view>
		</div>
	</template>
	<script>
	// 用户中心
	var Account = {
		template: '#tem'
	}
	// 登录
	var login = {
		template:' <h1>登录</h1> '
	}
	// 注册
	var register = {
		template:' <h1>注册</h1> '
	}

	var router = new VueRouter({
		routes: [
			{
				path: '/account',
				component: Account,
				children: [
					{ path: 'login' , component: login },
					{ path: 'register' , component: register }
				]
			}
		]
	});
	// 创建 vm
	var vm = new Vue({
		el: '#app',
		data: {},
		methods: {},
		components: {
			'tem-box': Account
		},
		router
	});
	</script>
</body>
</html>